import { request } from 'ice';

export default {
  // 列表
  async getBrandPage(pageParams: ICommon.PageParams, formData: BrandState.BrandQueryParams) {
    const params = {
      ...pageParams,
      ...formData,
    };
    return await request.get('/pms/brand/query', { params }).then((res) => ({
      total: res?.total || 0,
      list: res?.data || [],
    }));
  },
  // 禁用、启用
  async enableStatus(params: ICommon.EnableParams) {
    return await request.get('/pms/brand/enable', { params });
  },
  // 新增、编辑
  async createBrand(data: BrandState.BrandItem) {
    return await request.post('/pms/brand/save', data);
  },
};
